generalized_maxwell_slip_model Derived Type

type, public, extends(friction_model) :: generalized_maxwell_slip_model

A representation of the Generalized Maxwell Slip model.

The Generalized Maxwell Slip model is defined as follows.

where:

Friction Force

Normal Force

Attraction Coefficient

Position

Velocity

Coulomb Friction Coefficient

Static Friction Coefficient

i-th Element Stiffness

i-th Element Damping Coefficient

Viscous Damping Coefficient

Frictional Stiffness

Stribeck Curve Shape Factor

Stribeck Velocity Coefficient

i-th Element Scaling Factor


Components

Type Visibility Attributes Name Initial
real(kind=real64), public :: attraction_coefficient

The attraction coefficient.

real(kind=real64), public :: coulomb_coefficient

The Coulomb (dynamic) friction coefficient.

real(kind=real64), public :: shape_parameter

The Stribeck curve shape parameter.

real(kind=real64), public :: static_coefficient

The static friction coefficient.

real(kind=real64), public :: stiffness

The frictional stiffness.

real(kind=real64), public :: stribeck_velocity

The Stribeck velocity parameter.

real(kind=real64), public :: viscous_damping

The viscous damping coefficient.


Type-Bound Procedures

procedure, public :: constraint_equations => fmdl_constraints

  • private subroutine fmdl_constraints(this, t, x, dxdt, nrm, f, rst)

    Overload this routine to establish constraings for the model to be enforced as part of the fitting operation.

    Arguments

    Type IntentOptional Attributes Name
    class(friction_model), intent(in) :: this

    The friction_model object.

    real(kind=real64), intent(in), dimension(:) :: t

    An N-element array containing the time points at which the data to be fit was sampled.

    real(kind=real64), intent(in), dimension(:) :: x

    An N-element array containing the relative motion data.

    real(kind=real64), intent(in), dimension(:) :: dxdt

    An N-element array containing the relative velocity data.

    real(kind=real64), intent(in), dimension(:) :: nrm

    An N-element array containing the normal force data.

    real(kind=real64), intent(in), dimension(:) :: f

    An N-element array containing the friction force data.

    real(kind=real64), intent(out), dimension(:) :: rst

    An M-element array where the results of the constraint equations will be written. M must be equal to the number of constraint equations for the model.

procedure, public :: element_state => gmsm_element_state_model

  • private pure function gmsm_element_state_model(this, i, t, x, dxdt, nrm, z) result(rst)

    Computes the state equation for a single element.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: i

    The index of the element.

    real(kind=real64), intent(in) :: t

    The current simulation time value.

    real(kind=real64), intent(in) :: x

    The current value of the relative position between the contacting bodies.

    real(kind=real64), intent(in) :: dxdt

    The current value of the relative velocity between the contacting bodies.

    real(kind=real64), intent(in) :: nrm

    The current normal force between the contacting bodies.

    real(kind=real64), intent(in) :: z

    The current value of the state variable for the element.

    Return Value real(kind=real64)

    The value of the state equation.

procedure, public :: evaluate => gmsm_eval

  • private function gmsm_eval(this, t, x, dxdt, nrm, svars) result(rst)

    Evaluates the friction model given the defined parameter state.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(inout) :: this

    The generalized_maxwell_slip_model object.

    real(kind=real64), intent(in) :: t

    The current simulation time value.

    real(kind=real64), intent(in) :: x

    The current value of the relative position between the contacting bodies.

    real(kind=real64), intent(in) :: dxdt

    The current value of the relative velocity between the contacting bodies.

    real(kind=real64), intent(in) :: nrm

    The current normal force between the contacting bodies.

    real(kind=real64), intent(in), optional, dimension(:) :: svars

    An optional array containing any internal state variables the model may rely upon.

    Return Value real(kind=real64)

    The friction force.

procedure, public :: fit => fmdl_fit

  • private subroutine fmdl_fit(this, t, x, v, f, n, weights, maxp, minp, alpha, integrator, controls, settings, info, stats, fmod, resid, err)

    Attempts to fit a friction model to the supplied data using a Levenberg-Marquardt solver.

    Arguments

    Type IntentOptional Attributes Name
    class(friction_model), intent(inout), target :: this

    The friction model. On output, the model is updated with the final, fitted parameters.

    real(kind=real64), intent(in), target, dimension(:) :: t

    An N-element array containing the time points at which the friction data was sampled. This array must contain monotonically increasing data.

    real(kind=real64), intent(in), target, dimension(:) :: x

    An N-element array containing the relative position data.

    real(kind=real64), intent(in), target, dimension(:) :: v

    An N-element array containing the relative velocity data.

    real(kind=real64), intent(in), target, dimension(:) :: f

    An N-element array containing the friction force data.

    real(kind=real64), intent(in), target, dimension(:) :: n

    An N-element array containing the normal force data.

    real(kind=real64), intent(in), optional, dimension(:) :: weights

    An optional N-element array that can be used to weight specific data points. The default is an array of all ones such that all points are weighted equally.

    real(kind=real64), intent(in), optional, dimension(:) :: maxp

    An M-element array (M = the number of model parameters) containing a maximum limit for each model parameter.

    real(kind=real64), intent(in), optional, dimension(:) :: minp

    An M-element array containing the minimum limit for each model parameter.

    real(kind=real64), intent(in), optional :: alpha

    An optional input that defines the significance level at which to evaluate the confidence intervals. The default value is 0.05 such that a 95% confidence interval is calculated.

    class(ode_integrator), intent(inout), optional, target :: integrator

    An optional input, used in the event the model has internal state variables, that provides integration of the state equations. The defaults is a 4th order Rosenbrock method.

    type(iteration_controls), intent(in), optional :: controls

    An optional input providing custom iteration controls.

    type(lm_solver_options), intent(in), optional :: settings

    An optional input providing custom settings for the solver.

    type(convergence_info), intent(out), optional :: info

    An optional output that can be used to gain information about the iterative solution and the nature of the convergence.

    type(regression_statistics), intent(out), optional, dimension(:) :: stats

    An optional output array of M-elements that can be used to retrieve statistical information regarding the fit of each of the M model parameters.

    real(kind=real64), intent(out), optional, target, dimension(:) :: fmod

    An optional N-element array used to provide the fitted model results.

    real(kind=real64), intent(out), optional, target, dimension(:) :: resid

    An optional N-element array containing the fitted residuals.

    class(errors), intent(inout), optional, target :: err

    An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling.

procedure, public :: from_array => gmsm_from_array

  • private subroutine gmsm_from_array(this, x, err)

    Converts an array into the parameters for the friction model.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(inout) :: this

    The generalized_maxwell_slip_model object.

    real(kind=real64), intent(in), dimension(:) :: x

    The array of parameters. See parameter_count to determine the size of this array. The parameter order is as follows:

    1. static_coefficient

    2. coulomb_coefficient

    3. attraction_coefficient

    4. stiffness

    5. viscous_damping

    6. stribeck_velocity

    7. shape_parameter

    8. element stiffness

    9. element damping

    10. element scaling ...

    class(errors), intent(inout), optional, target :: err

    An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling.

procedure, public :: get_constraint_equation_count => gmsm_get_constraint_count

  • private pure function gmsm_get_constraint_count(this) result(rst)

    Gets the number of constraint equations the model requires to be satisfied when fitting to data.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    Return Value integer(kind=int32)

    The number of constraint equations.

procedure, public :: get_element_count => gmsm_get_element_count

  • private pure function gmsm_get_element_count(this) result(rst)

    Gets the number of friction elements in the model.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    Return Value integer(kind=int32)

    The number of friction elements in the model.

procedure, public :: get_element_damping => gmsm_get_element_damping

  • private pure function gmsm_get_element_damping(this, i) result(rst)

    Gets the damping term for the specified element.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: i

    The index of the element.

    Return Value real(kind=real64)

    The requested value.

procedure, public :: get_element_scaling => gmsm_get_element_scaling

  • private pure function gmsm_get_element_scaling(this, i) result(rst)

    Gets the scaling factor for the specified element.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: i

    The index of the element.

    Return Value real(kind=real64)

    The requested value.

procedure, public :: get_element_stiffness => gmsm_get_element_stiffness

  • private pure function gmsm_get_element_stiffness(this, i) result(rst)

    Gets the stiffness term for the specified element.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: i

    The index of the element.

    Return Value real(kind=real64)

    The requested value.

procedure, public :: get_state_variable_count => gmsm_get_state_var_count

  • private pure function gmsm_get_state_var_count(this) result(rst)

    Gets the number of internal state variables used by the model.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    Return Value integer(kind=int32)

    The internal state variable count.

procedure, public :: has_internal_state => gmsm_has_state_vars

  • private pure function gmsm_has_state_vars(this) result(rst)

    Returns a value stating if the model relies upon internal state variables.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    Return Value logical

    Returns true if the model utilizes internal state variables; else, returns false.

procedure, public :: initialize => gmsm_initialize

  • private subroutine gmsm_initialize(this, n, err)

    Initializes the model.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(inout) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: n

    The number of friction elements. This value must be at least 1.

    class(errors), intent(inout), optional, target :: err

    An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling.

procedure, public :: parameter_count => gmsm_parameter_count

  • private pure function gmsm_parameter_count(this) result(rst)

    Gets the number of model parameters.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    Return Value integer(kind=int32)

    The number of model parameters.

procedure, public :: reset => fmdl_reset

  • private subroutine fmdl_reset(this)

    Resets the friction model to it's original state.

    Arguments

    Type IntentOptional Attributes Name
    class(friction_model), intent(inout) :: this

    The friction_model object.

procedure, public :: set_element_damping => gmsm_set_element_damping

  • private function gmsm_set_element_damping(this, i, x) result(rst)

    Sets the damping term for the specified element.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(inout) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: i

    The index of the element.

    real(kind=real64), intent(in) :: x

    The value.

    Return Value logical

    Returns true if the operation was successful; else, returns false if the object has not yet been initialized.

procedure, public :: set_element_scaling => gmsm_set_element_scaling

  • private function gmsm_set_element_scaling(this, i, x) result(rst)

    Sets the scaling factor for the specified element.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(inout) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: i

    The index of the element.

    real(kind=real64), intent(in) :: x

    The value.

    Return Value logical

    Returns true if the operation was successful; else, returns false if the object has not yet been initialized.

procedure, public :: set_element_stiffness => gmsm_set_element_stiffness

  • private function gmsm_set_element_stiffness(this, i, x) result(rst)

    Sets the stiffness term for the specified element.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(inout) :: this

    The generalized_maxwell_slip_model object.

    integer(kind=int32), intent(in) :: i

    The index of the element.

    real(kind=real64), intent(in) :: x

    The value.

    Return Value logical

    Returns true if the operation was successful; else, returns false if the object has not yet been initialized.

procedure, public :: state => gmsm_state_model

  • private subroutine gmsm_state_model(this, t, x, dxdt, nrm, svars, dsdt)

    Evaluates the time derivatives of the internal friction state model.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(inout) :: this

    The generalized_maxwell_slip_model object.

    real(kind=real64), intent(in) :: t

    The current simulation time value.

    real(kind=real64), intent(in) :: x

    The current value of the relative position between the contacting bodies.

    real(kind=real64), intent(in) :: dxdt

    The current value of the relative velocity between the contacting bodies.

    real(kind=real64), intent(in) :: nrm

    The current normal force between the contacting bodies.

    real(kind=real64), intent(in), dimension(:) :: svars

    An N-element array containing any internal state variables the model may rely upon.

    real(kind=real64), intent(out), dimension(:) :: dsdt

    An N-element array where the state variable derivatives are to be written.

procedure, public :: stribeck_function => gmsm_stribeck_curve

  • private pure function gmsm_stribeck_curve(this, dxdt, nrm) result(rst)

    Evaluates the Stribeck function for the model.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    real(kind=real64), intent(in) :: dxdt

    The relative velocity between the contacting bodies.

    real(kind=real64), intent(in) :: nrm

    The normal force between the contacting bodies.

    Return Value real(kind=real64)

    The value of the Stribeck function. The units are units of position.

procedure, public :: to_array => gmsm_to_array

  • private subroutine gmsm_to_array(this, x, err)

    Converts the parameters of the friction model into an array.

    Arguments

    Type IntentOptional Attributes Name
    class(generalized_maxwell_slip_model), intent(in) :: this

    The generalized_maxwell_slip_model object.

    real(kind=real64), intent(out), dimension(:) :: x

    The array used to store the parameters. See parameter_count to determine the size of this array. The parameter order is as follows:

    1. static_coefficient

    2. coulomb_coefficient

    3. attraction_coefficient

    4. stiffness

    5. viscous_damping

    6. stribeck_velocity

    7. shape_parameter

    8. element stiffness

    9. element damping

    10. element scaling ...

    class(errors), intent(inout), optional, target :: err

    An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling.